<?php

class UserIdentity extends CUserIdentity {
	public function authenticate() {
		$users=array(
			'demo'=>'demo',
			'admin'=>'admin',
		);
		if(!isset($users[$this->username]) 
				|| $users[$this->username]!==$this->password) {
			
			$this->errorCode=RestDefine::ERR_UNAUTHORIZED;
		}
		else
			$this->errorCode=RestDefine::ERR_NONE;
		return !$this->errorCode;
	}
}